package com.example.controller;

import com.example.data.request.ReqProfessionList;
import com.example.entity.Profession;
import com.example.service.impl.ProfessionServiceImpl;
import com.example.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * Author:yanghua
 * Date:2023/10/7 18:03
 */
@Slf4j
@RestController
@RequestMapping("profession")
public class ProfessionController {
    @Resource
    private ProfessionServiceImpl professionService;
    @PostMapping("addProfession")
    private R add(@RequestBody Profession profession) {
        return professionService.addOneProfession(profession);
    }
    @DeleteMapping("deleteById/{id}")
    private R deleteById(@PathVariable Long id) {
        return professionService.deleteOneProfession(id);
    }
    @PutMapping("updateProfession")
    private R update(@RequestBody Profession profession) {
        return professionService.updateProfession(profession);
    }
    @PostMapping("getProfessionList")
    private R getProfessionList(@RequestBody ReqProfessionList reqProfessionList) {
        return professionService.getProfessionList(reqProfessionList);
    }
}
